﻿@model SiteScopeConfigurationModel
@using IT.CMS.Core


@{
    var webHelper = EngineContext.Current.Resolve<IWebHelper>();

    var sites = Model.Sites.Select(site => new SelectListItem
        {
            Text = site.Name,
            Value = webHelper.ModifyQueryString(Url.Action("ChangeSiteScopeConfiguration", new { siteid = site.Id }), "returnurl=" + HttpUtility.UrlEncode(HttpContext.Current.Request.RawUrl), null),
            Selected = site.Id.Equals(Model.SiteId)
        })
        .ToList();
    sites.Insert(0, new SelectListItem()
    {
        Text = T("Admin.Configuration.Settings.SiteScope.AllSites").Text,
        Value = webHelper.ModifyQueryString(Url.Action("ChangeSiteScopeConfiguration", new { siteid = 0 }), "returnurl=" + HttpUtility.UrlEncode(HttpContext.Current.Request.RawUrl), null),
        Selected = 0.Equals(Model.SiteId)
    });
}
<div class="multi-site-scope">
    <div class="selector">
        <span class="title">@T("Admin.Configuration.Settings.SiteScope")</span>
        @Html.DropDownList("site-scope-configuration", sites, new { onchange = "setLocation(this.value);" })
    </div>
    @if (Model.SiteId > 0)
    {
        <div class="check-all">
            <input type="checkbox" style="vertical-align: text-top" onclick="checkAllOverridenSiteValue(this)">
            <b>@T("Admin.Configuration.Settings.SiteScope.CheckAll")</b> @T("Admin.Configuration.Settings.SiteScope.CheckAll.Hint")
        </div>
    }
</div>

